package com.zbkj.crmeb.front.controller;


import com.common.CommonPage;
import com.crmeb.core.common.CommonResult;
import com.common.PageParamRequest;
import com.zbkj.crmeb.store.model.StoreAccountInfo;
import com.zbkj.crmeb.store.request.StoreAccountInfoRequest;
import com.zbkj.crmeb.store.service.StoreAccountInfoService;
import com.zbkj.crmeb.user.service.UserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * 查询账户明细
 * @author cyz
 * @date 2021/4/12 19:22
 */
@Slf4j
@RestController("StoreAccountInfoController")
@RequestMapping("api/front/accountInfo")
@Api(tags = "查询账户明细")
public class StoreAccountInfoController {

    @Autowired
    private StoreAccountInfoService storeAccountInfoService;
    @Autowired
    private UserService userService;

    @ApiOperation(value = "查询账户明细列表")
    @RequestMapping(value = "/list", method = RequestMethod.GET)
    public CommonResult<CommonPage<StoreAccountInfo>> list(@Validated StoreAccountInfoRequest request, PageParamRequest pageParamRequest){
        request.setUid(userService.getUserIdException());
        return CommonResult.success(CommonPage.restPage(storeAccountInfoService.getList(request,pageParamRequest)));
    }
}



